CHECK FOR UNDERSTANDING: Take a look at the editor below. At the top of the program is a refactored version of the code you saw in the last activity. To refactor, we replaced the old code with a new version, but our program still does exactly the same thing. Our code now uses a function and a loop to be less repetitive.

  • Click Run and notice that the panther does the same thing as in the last activity.
  • Use the code in the editor below to answer the questions that appear on the stage.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)